package org.pidan.basic.designModel.builder;

/**
 * {@code @description}: 建造者模型
 * Director（调用具体建造者来创建复杂对象的各个部分，在指导者中不涉及具体产品的信息，只负责保证对象各部分完整创建或按某种顺序创建）
 * 4
 * {@code @author}: huangyuxin
 * {@code @date}: 2023-11-16
 */
public class PersonDirector {

    //组装
    public Arms constructPerson(PersonBuilder personBuilder) {
        personBuilder.buildHelmetYanLong();
        personBuilder.buildArmorYanLong();
        personBuilder.buildWeaponFengYing();
        return personBuilder.BuildArms();
    }


    public static void main(String[] args) {

        PersonDirector personDirector = new PersonDirector();
        Arms arms = personDirector.constructPerson(new ArmsBuilder());
        System.out.println(arms.getHelmet());
        System.out.println(arms.getArmor());
        System.out.println(arms.getWeapon());
    }
}
